﻿using System;

namespace CSharpTest.Constont
{
    [Flags]
    public enum BorderSiders
    {
        None = 0,
        Left = 1,
        Right = 2,
        Top = 4,
        Bottom = 8,
        LeftRight = Left | Right,
        TopBottom = Top | Bottom,
        All = LeftRight | TopBottom

    }

    public class UseEnum
    {
        public void Test(BorderSiders b)
        {
            b = b + 1;
            switch (b)
            {
                case BorderSiders.None:
                    break;
                default:
                    throw new ArgumentException("非法枚举");
                
            }
        }
    }
}